package org.log;

import java.text.SimpleDateFormat;
import java.util.Date;

import org.apache.logging.log4j.Logger;

public class LogBase {
	public final Logger log = org.apache.logging.log4j.LogManager.getLogger(getClass());
	
	public static void main(String[] args) {
		
		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss SSS");
		System.out.println("begin:"+sdf.format(new Date()));
		Logger log = org.apache.logging.log4j.LogManager.getLogger(LogBase.class);
		for (int i=0;i<1000000;i++){
			log.info("ssssssss");
			/*StackTraceElement[] stacks = Thread.currentThread().getStackTrace(); 
			String location="";  
			 location = "类名："+stacks[1].getClassName() + "\n函数名：" + stacks[1].getMethodName()  
				        + "\n文件名：" + stacks[1].getFileName() + "\n行号："  
				        + stacks[1].getLineNumber() + ""; */
				        //System.out.println(location);  
		}
		System.out.println("end:"+sdf.format(new Date()));
	}
}
